import request from "@/utils/request";

// 查询公共机构基本信息列表 错误码  20030
export function getInstitutionslist(params) {
  return request({
    url: "/system/institutions/list",
    method: "get",
    params,
  });
}

// 查询公共机构概况(饼图） 错误码 20031
export function getInstitutionspie(params) {
  return request({
    url: "/system/institutions/public/institution/list",
    method: "get",
    params,
  });
}

// 获取基本信息详情 错误码 20032
export function getInstitutiondetail(id) {
  return request({
    url: `/system/institutions/${id}`,
    method: "get",
  });
}

// 导入设备档案数据 错误码 20039
export function postImportData(data) {
  return request({
    url: "/system/institutions/importData",
    method: "post",
    data,
  });
}

// 模板下载 错误码 20033
export function gettTemplatedownload() {
  return request({
    url: "/system/institutions/template/download",
    method: "get",
  });
}

// 导出pdf 错误码 20034
export function getExportpdf(id) {
  return request({
    url: `/system/institutions/export/pdf/${id}`,
    method: "get",
  });
}

// 新增基本信息详情 错误码 20035
export function postInstitution(data) {
  return request({
    url: "/system/institutions",
    method: "post",
    data,
  });
}

// 修改基本信息详情 错误码 20036
export function putInstitution(data) {
  return request({
    url: "/system/institutions",
    method: "put",
    data,
  });
}

// 提交公共机构基本信息 错误码 20037
export function reportInstitution(id) {
  return request({
    url: `/system/institutions/submit/${id}`,
    method: "get",
  });
}

// 审核公共机构基本信息 错误码 20038
export function auditInstitution(data) {
  return request({
    url: "/system/institutions/audit",
    method: "post",
    data,
  });
}

// 获取审核信息详情 错误码 20039
export function getAuditmsg(id) {
  return request({
    url: `/system/institutions/audit/info/${id}`,
    method: "get",
  });
}

// 审核通过后上报公共机构信息 错误码 200391
export function upInstitution(id) {
  return request({
    url: `/system/institutions/report/${id}`,
    method: "get",
  });
}

// 填报人确认 错误码 200392
export function postConfirm(data) {
  return request({
    url: "/system/institutions/confirm",
    method: "post",
    data,
  });
}
